

package com.qdu.servlet;

import com.qdu.entity.Users;
import com.qdu.service.AdminService;
import com.qdu.service.impl.AdminServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author 24959
 */
@WebServlet("/gau")
public class GetAllUserServlet extends HttpServlet{
    AdminService as=new AdminServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        
        List<Users> list =  as.findAllUsers(); 
        req.setAttribute("usersList", list); 
        req.getRequestDispatcher("/manageUsers.jsp").forward(req, resp);
    }

    

}
